package com.umeox.moto.mqtt;


import java.io.InputStream;

public class MqttConfigure {
    public static final String DEFAULT_HOST = "wpush.wherecom.com:18883";

    public static String mqttClientId;
    public static String mqttUserName;
    public static String mqttPassword;
    public static String mqttHost = null;
    public static boolean isCheckRootCrt = false;
    public static InputStream mqttRootCrtFile;
    public static boolean cleanSession = true;
    private static int keepAliveInterval = 65;

    public MqttConfigure() {
    }

    public static boolean setKeepAliveInterval(int keepAliveIntervalSec) {
        if (keepAliveIntervalSec == 0) {
            keepAliveInterval = 0;
            return true;
        } else if (keepAliveIntervalSec >= 60 && keepAliveIntervalSec <= 300) {
            keepAliveInterval = keepAliveIntervalSec;
            return true;
        } else {
            return false;
        }
    }

    public static int getKeepAliveInterval() {
        return keepAliveInterval;
    }

}
